package cn.singno.springBoot.demo.ch14_test;

import junit.framework.Assert;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes = {TestConfig.class})
@ActiveProfiles("prod")
public class DemoBeanIntegerTests
{
	@Autowired
	private TestBean testBean;
	
	private static Logger Logger = LoggerFactory.getLogger(DemoBeanIntegerTests.class);
	
	@Test
	public void testname() throws Exception
        {
	        String expected = "from production profile";
	        String actual = testBean.getContent();
	        Assert.assertEquals(expected, actual);
	        Assert.assertTrue("错误", !expected.equals(actual));
        }
	
	@Test
	public void testname2() throws Exception
        {
		Logger.error("Test the MessageFormat for {} to {} endTo {}", 1,2,3);
        }
}
